//
//  TestLLDBController.m
//  testApp
//
//  Created by iMac on 2018/2/26.
//  Copyright © 2018年 iMac. All rights reserved.
//

#import "TestLLDBController.h"
#import "UIView+Frame.h"

@interface TestLLDBController ()

@property (nonatomic, strong) UIButton *dismiss;
@property (nonatomic, strong) UILabel *displayLable;

@end

@implementation TestLLDBController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    self.displayLable = ({
        UILabel *lable = [[UILabel alloc] init];
//        lable.frame = CGRectMake(0, self.dismiss.y - 100, [UIScreen mainScreen].bounds.size.width, 100);
        lable.textColor = [UIColor blueColor];
        lable.text = @"这是lable最初显示的东西";
        lable.backgroundColor = [UIColor lightGrayColor];
        lable.font = [UIFont systemFontOfSize:20];
        lable;
    });
    [self.view addSubview:self.dismiss];
    [self.view addSubview:self.displayLable];
    [self.displayLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.view.right);
        make.bottom.mas_equalTo(self.view.bottom);
        make.size.mas_equalTo(CGSizeMake(100, 100));
    }];
    
    /*
     
    
     
     */
    
    
    
    
}



- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    NSString *str = @"这厮一个字符串";
    
    NSLog(@"使用 str , 打印一下: %@", str);
    
    
}






- (UIButton *)dismiss {
    if (!_dismiss) {
        CGFloat width = 100;
        _dismiss = [[UIButton alloc] init];
        _dismiss.frame = CGRectMake(self.view.right - width, self.view.bottom - 100, width, width);
        _dismiss.backgroundColor = [UIColor purpleColor];
        [_dismiss setTitle:@"dismiss" forState:UIControlStateNormal];
        [_dismiss addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _dismiss;
}
- (void)back:(UIButton *)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}


- (void)changeViewBackgroundColor {
    NSLog(@"%d", (arc4random() % 255));
    self.view.backgroundColor = [UIColor colorWithRed:(arc4random() % 255)/255.0
                                                green:(arc4random() % 255)/255.0
                                                 blue:(arc4random() % 255)/255.0
                                                alpha:1.f];
}
@end
